for (var i = 0; i < result.rows.length; i++) { var row = result.rows.item(i);
properties[row.name] = row.value;
export class UpdateStorage implements attached.UpdateStorage { private _cachedUpdateStatementsByFile: { [name: string]: string; } = {}; private _unhandledClosure = (e: SQLError) => this.unhandledSQLError(e);
private _unhandledTransClosure = (t: SQLTransaction, e: SQLError) => this.unhandledSQLError(e);
existingFiles: string[]) { existingFiles.forEach(file=> this._createUpdateStatement(file));
update(file: string, property: string, value: string) { var updateSQL = this._cachedUpdateStatementsByFile[file];
if (typeof updateSQL === 'string') { transaction=> transaction.executeSql(
(transaction, result) => { }, this._unhandledTransClosure),
mangleDatabaseObjectName(file),
'DROP TABLE "' + mangleDatabaseObjectName(file) + '"',
(transaction, result) => { }, this._unhandledTransClosure),
unhandledSQLError(sqlError: SQLError) { if (typeof console !== 'undefined' && console && console.error)
private _createUpdateStatement(file: string) { return this._cachedUpdateStatementsByFile[file] =
'INSERT OR REPLACE INTO "' +
mangleDatabaseObjectName(file) +
private _createTable(tableName: string, callback: (transaction: SQLTransaction) => void) { 'CREATE TABLE "' + tableName + '" (name PRIMARY KEY, value)',
(transaction, result) => callback(transaction),
this._unhandledTransClosure),
private _updateEditedCore(transaction: SQLTransaction) {